<template>
	<view class="content">
		<view class="none_msg" v-if="InfoList.length == 0">
			<image src="../../static/image/offerxq_img_k@2x.png" mode=""></image>
			<view class="none_title">暂无信息</view>
		</view>
		
		<scroll-view class="list_box_all" :scroll-y="true"  lower-threshold="50" @scrolltolower="lowerY">
			<view class="list_box">
			<view class="list_item" v-for="(item,index) in InfoList" :key="index" @click="goDet(item.c_id)">
				<view class="list_left">
					<image :src="picture.getImgUrl(item.curriculum.image)" mode=""></image>
				</view>
				<view class="list_right">
					<view class="list_right_title">{{item.curriculum.name}}</view>
					<view class="list_tip">{{item.all_num}}套真题|讲义</view>
				</view>
			</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {mycurriculum} from '@/api/personal.js'
	export default {
		data() {
			return {
				InfoList:[],
				page:1,
				limit:10
			}
		},
		onLoad() {
			this.getInfoList()
		},
		methods: {
			lowerY(){
				if(this.InfoList.length!=0){
					this.page=this.page+1
					this.getInfoList()
				}else{
				    this.$msg('暂无更多')
				}
			},
			getInfoList(){
				var obj = {
					page:this.page,
					pageSize:this.limit
				};
				mycurriculum(obj).then(res => {
					if (res.code == 1) {
						if(this.page == 1){
							console.log(res);
							this.InfoList=res.data.data
						}else{
							this.InfoList = this.InfoList.concat(res.data.data)
						}
					}
				})
			},
			goDet(id){
				uni.navigateTo({
					url:'../data/kecheng?id='+id
				})
			}
		}
	}
</script>

<style>
	.content{
		width: 100%;
		height: 100%;
		/* overflow-y: auto; */
	}
	.list_box_all{
		width: 100%;
		height: 100%;
	}
	.list_box{
		width: 100%;
		height: auto;
		background-color: #FFFFFF;
		padding: 0 30rpx;
		margin-top: 20rpx;
	}
	.list_item{
		width: 100%;
		height: 190rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;
	}
	.list_left image{
		width: 196rpx;
		height: 130rpx;
		border-radius: 10rpx;
	}
	.list_right{
		width: 68%;
		height: 100%;
		margin-left: 20rpx;
		padding-top: 30rpx;
		border-bottom: 1rpx solid #F5F5F5;
	}
	.list_right_title{
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
	}
	.list_tip{
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
		margin-top: 10rpx;
	}
	/* 暂无消息 */
	.none_msg {
		width: 100%;
		height: auto;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		margin-top: 300rpx;
	}
	
	.none_msg image {
		width: 354rpx;
		height: 253rpx;
	}
	
	.none_title {
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #666666;
		margin-top: 40rpx;
	}

</style>
